

            $(function () {

                var token=localStorage.phone;
                $.ajax({
                    url:'https://newapp.icandrive.cn/api/coach_photo.php',
                    data:{token:token},
                    dataType:'json',
                    type:'post',
                    success: function (data) {
                        if(data.status==200){
                            $(data.data).each(function () {
                                $('.left-header img').attr('src',this.teacher_photo);
                                $('.username h3').html(this.teacher_name);
                                $('#signature').val(this.autograph);
                                localStorage.place1=(this.subject2_place);
                                localStorage.place2=(this.subject3_place);
                            });

                        }
                    }
                })
                $('#signature').bind('change',function(){
                    var content=$(this).val();
                    var token=localStorage.phone;
                    $.ajax({
                        url:'https://newapp.icandrive.cn/api/teacher_intro.php',
                        data:{token:token,content:content},
                        dataType:'json',
                        type:'post',
                        success: function (data) {
                            if(data.status==200){

                            }
                            else{
                                layer.msg('保存失败')
                            }
                        },
                        error:function(){
                            layer.msg('系统繁忙')
                        }
                    })

                })

            });
           var xhr;

            function createXMLHttpRequest() {
                if (window.ActiveXObject) {
                    xhr = new ActiveXObject("Microsoft.XMLHTTP");
                } else if (window.XMLHttpRequest) {
                    xhr = new XMLHttpRequest();
                }
            }

            function UpladFile() {
                var token=localStorage.phone;
                var fileObj = document.getElementById("file").files[0];
                var FileController = 'https://newapp.icandrive.cn/api/photo.php?token='+token;
                var form = new FormData();
                form.append("myfile", fileObj);
                createXMLHttpRequest();
                xhr.onreadystatechange = handleStateChange;
                xhr.open("post", FileController, true);
                xhr.send(form);
            }

            function handleStateChange() {
                if (xhr.readyState == 4) {
                    if (xhr.status == 200 || xhr.status == 0) {
                        var result = xhr.responseText;
                        var json = eval("(" + result + ")");
                        setTimeout(function(){
                            history.go(0)
                        },2000)

                    }
                }
            }

            // $("#zhuxiao").click(function() {
            //     localStorage.removeItem("savalogintooken");
            //     localStorage.removeItem('phone');
            //     window.location.href = "../login/log_in.html";
            // });
            window.onload = function () {
                var zhuxiao = document.getElementById("zhuxiao");

                zhuxiao.onclick = function(){
                    localStorage.removeItem("savalogintoken");
                    localStorage.removeItem('phone');
                    localStorage.removeItem('savalogintooken')
                    window.location.href = "../login/log_in.html"
                }

            };

setFontSize(1080);


/*监听手机返回按键*/
 return_keybord();
